package com.gjy.mongo.sp;

import org.jetbrains.annotations.NotNull;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * 为了实现创建者、最后修改者字段的自动注入
 *
 * @author 宫静雨
 * @version 1.0
 * @since 2023-01-30 10:56:25
 */
@Component
public class AuditAwareImpl implements AuditorAware<String> {
    @NotNull
    @Override
    public Optional<String> getCurrentAuditor() {
        return Optional.of("Encrypt");
    }
}
